function load() {
	document.getElementById("timer").innerHTML=(new Date).getTime();
}

function options() {
	alert("Options");
}

function report() {
	alert(kango.storage.getItem("sites"));
}

function get_current_url() {
    current = "";
    // output current tab url to console
    kango.browser.tabs.getCurrent(function(tab) {
            // tab is KangoBrowserTab object
            current = tab.getUrl();
    });
    return current;
    //alert(kango.browser.tabs.getCurrent().getUrl());
    //return kango.browser.tabs.getCurrent().getUrl();
}    

separator = "*";
function get_curr_site() {
	var res = kango.browser.tabs.getCurrent(function(tab) {
        // tab is KangoBrowserTab object
        return tab.getUrl();
	});
	alert(res);
	return res;
}
function add_break_site(site_url) {
	var break_sites = kango.storage.getItem("sites");
	if (break_sites == null || break_sites == "") {
		break_sites = site_url;
	} else {
		break_sites = break_sites + separator + site_url;
	}
	alert('added: ' + site_url);
	kango.storage.setItem("sites", break_sites);
}

function remove_break_site(site_url) {
	var break_sites = kango.storage.getItem("sites");
	if (break_sites == null || break_sites == "") {
		return;
	}
	var list_of_sites = break_sites.split(separator)
	var updated_list = new Array();
	for (var i = 0; i < list_of_sites.length; i++) {
		if (site_url != list_of_sites[i]) {
			updated_list.push(list_of_sites[i]);
		}
	}
	kango.storage.setItem("sites", updated_list.join(separator));
}


